package com.yict.csms.system.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * 权限表Entity
 * 
 * @author Patrick.Deng
 * 
 */
@Entity
@Table(name = "CSMS_PERMISSION")
public class Permission {

	@Id
	@Column(name = "PERMISSIONID")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "csms_permission_seq")
	@SequenceGenerator(name = "csms_permission_seq", sequenceName = "SEQ_CSMS_PERMISSION", allocationSize = 1, initialValue = 1)
	private Long permissionId;

	@Column(name = "PERMISSIONCODE")
	private String permissionCode;

	@Column(name = "PERMISSIONNAME")
	private String permissionName;

	@Column(name = "REMARKS")
	private String remarks;

	@Column(name = "CREATEDATE")
	private Date createDate;

	@Column(name = "UPDATEDATE")
	private Date updateDate;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CREATEPERSON", nullable = false)
	private User createPerson;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "UPDATEPERSON", nullable = false)
	private User updatePerson;

	public Long getPermissionId() {
		return permissionId;
	}

	public void setPermissionId(Long permissionId) {
		this.permissionId = permissionId;
	}

	public String getPermissionCode() {
		return permissionCode;
	}

	public void setPermissionCode(String permissionCode) {
		this.permissionCode = permissionCode;
	}

	public String getPermissionName() {
		return permissionName;
	}

	public void setPermissionName(String permissionName) {
		this.permissionName = permissionName;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public User getCreatePerson() {
		return createPerson;
	}

	public void setCreatePerson(User createPerson) {
		this.createPerson = createPerson;
	}

	public User getUpdatePerson() {
		return updatePerson;
	}

	public void setUpdatePerson(User updatePerson) {
		this.updatePerson = updatePerson;
	}
	
}
